<form [formGroup]="form" (ngSubmit)="onSubmit(form,$event)"> <!-- 响应式表单必须有一个FormGroup -->
    <mat-card>
        <mat-card-header>
            <!-- <div mat-card-avatar>avatar</div> 头像 -->
            <mat-card-title>用户登录</mat-card-title>
            <!-- <mat-card-subtitle>sub-header</mat-card-subtitle> 副标题 -->
        </mat-card-header>
        <mat-card-content>
            <mat-form-field class="full-width">
                <input matInput placeholder="输入邮箱" formControlName="email">
                <!-- <mat-error>{{form.controls['email'].errors | json}}</mat-error> -->
            </mat-form-field>
            <mat-form-field class="full-width">
                <input type="password" matInput placeholder="输入密码" formControlName="password">
            </mat-form-field>
            <button mat-raised-button color="accent" class="full-width" type="submit" [disabled]="!form.valid">登录</button>
        </mat-card-content>
        <mat-card-actions class="text-right">
            <p>还没有账户？<a routerLink="/register" mat-button>注册</a></p>
            <p>忘记密码？<button mat-button>找回</button></p>
        </mat-card-actions>
    </mat-card>
    <mat-card>
        <mat-card-header>
            <!-- <div mat-card-avatar>avatar</div> 头像 -->
            <mat-card-title>
                每日佳句
            </mat-card-title>
            <mat-card-subtitle>
               {{quote.cn}}
            </mat-card-subtitle>
        </mat-card-header>
        <img mat-card-image [src]="quote.pic" />
        <mat-card-content>
            {{quote.en}}
        </mat-card-content>
    </mat-card>
</form>